//echart_1湖南货物收入
function echart_1(alist,blist,tcname) {
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('chart_1'));

    /*
使用多重饼图，构造伪玫瑰图
主要是for循环构造图像数据
以及使用 color: "transparent" 图像颜色透明
*/

    //圆环比例为alist数值在总体的百分比
    // var alist = [200, 50, 100];
    //扇形高度为blist数值决定
    // var blist = [6, 1.5, 3];
    //blist数值*length = 图像高度
    var length = 5;
    //clist为一个对比参考数值，未参加图形构造属性
    var clist = [4.05, 2.95, 5];
    var pname = '检查比例';
    // var tcname = ['动态血压','静态心电','动态心电'];
    var colorlist = ['#368BFF','#FCFF00','#FEC619','#01FEE3','#FF3F3A','#00FE06']
    var msg = new Array();
    for(i=0;i<alist.length;i++){
        var ms = new Array();
        if(i == 0){//添加一组标题数据
            var ns = new Array();
            for(j=0;j<alist.length;j++){
                ns.push({
                    value: alist[j],
                    name: tcname[j],
                    hoverAnimation:false,
                    itemStyle: {
                        color: colorlist[j]
                    }
                });
            }
            msg.push({
                name: pname,
                type: 'pie',
                radius: [0,0],
                center: ['50%', '50%'],
                data:ns,
                label: {
                    show: false
                },
                emphasis: {
                    label: {
                        show: false
                    }
                },
            });
        }
        for(j=0;j<alist.length;j++){//封装构造数据
            if(i == j){
                ms.push({
                    value: alist[j],
                    name: tcname[j],
                    // hoverAnimation:false,
                    itemStyle: {
                        // color: colorlist[i],
                    },
                    label: {
                        color: "#fff",
                        fontSize: 12,
                        formatter: '{c} \n{a|'+tcname[i]+"({d}%)}",
                        rich: {
                            a: {
                                color: "#fff",
                                fontSize: 12,
                                lineHeight: 12
                            },
                        }
                    }
                });
            }else{
                ms.push({
                    value: alist[j],
                    name: tcname[j],
                    itemStyle: {
                        color: "transparent"
                    }
                });
            }
        }
        msg.push({
            name: pname,
            type: 'pie',
            radius: [50, 50 + blist[i] * length],
            center: ['50%', '50%'],
            data:ms,
        });
    }

    option = {
        backgroundColor:'',
        title: {
            text: "检查比例",
            x: 'center',
            y: 'center',
            textStyle: {
                color: "#fff",
                fontSize: 14,
                fontWeight: 'normal'
            },
        },
        tooltip: {
            trigger: 'item',
            formatter: function (v) {
                var key = v.dataIndex;
                return tcname[key]+":<br>"+alist[key]+" 人/次";
                // return tcname[key]+":<br>金额: "+alist[key]+" 亿元<br>加权平均利率: "+blist[key]+"%<br>市场参考利率: "+clist[key]+"%";
            }
        },
        color: colorlist,
        legend: {
            x: 'center',
            y: '90%',
            textStyle: {
                color: '#fff',
            },
            data: tcname
        },
        calculable: true,
        series: msg
    };




    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
    window.addEventListener("resize", function () {
        myChart.resize();
    });
}

//电子商务销售额、订单数
function echart_2(title,dtxdNum,dtxyNum,jtxdNum) {
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('chart_2'));
    myChart.clear();
    // var xData = function() {
    //     var data = [];
    //     for (var i = 1; i < 13; i++) {
    //         data.push(i + "号");
    //     }
    //     return data;
    // }();

    option = {
        backgroundColor:'',
        "title": {
            "text": "",
            x: "4%",
            textStyle: {
                color: '#fff',
                fontSize: '22'
            },
            subtextStyle: {
                color: '#fff',
                fontSize: '16',

            },
        },
        "tooltip": {
            "trigger": "axis",
            "axisPointer": {
                "type": "shadow",
                textStyle: {
                    color: "#fff"
                }

                },
            },
            "grid": {
                "borderWidth": 0,
                "top": 60,
                "bottom": 45,
                textStyle: {
                    color: "#fff"
                }
            },
            "legend": {
                x: '3%',
                top: '6%',
                textStyle: {
                     color: '#fff',
                },
                "data": ['静态心电', '动态心电', '动态血压']
            },


        "calculable": true,
        "xAxis": [{
            "type": "category",
            "axisLine": {
                lineStyle: {
                    color: '#fff'
                }
            },
            "splitLine": {
                "show": false
            },
            "axisTick": {
                "show": false
            },
            "splitArea": {
                "show": false
            },
            "axisLabel": {
                "interval": 0,

            },
            "data": title,
        }],
        "yAxis": [{
            "type": "value",
            "splitLine": {
                "show": false
            },
            "axisLine": {
                lineStyle: {
                    color: '#fff'
                }
            },
            "axisTick": {
                "show": false
            },
            "axisLabel": {
                "interval": 0,

            },
            "splitArea": {
                "show": false
            },

        }],
        // "dataZoom": [{
        //     "show": true,
        //     "height": 30,
        //     "xAxisIndex": [
        //         0
        //     ],
        //     bottom: 30,
        //     "start": 0,
        //     "end": 30,
        //     handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
        //     handleSize: '110%',
        //     handleStyle:{
        //         color:"#d3dee5",
        //
        //     },
        //     textStyle:{
        //         color:"#fff"},
        //     borderColor:"#fff"
        //
        //
        // }, {
        //     "type": "inside",
        //     "show": true,
        //     "height": 15,
        //     "start": 1,
        //     "end": 35
        // }],
        "series": [{
            "name": "静态心电",
            "type": "bar",
            "stack": "总量",
            "barMaxWidth": 35,
            "barGap": "10%",
            "itemStyle": {
                "normal": {
                    "color": "rgba(255,144,128,1)",
                    "label": {
                        "show": true,
                        "textStyle": {
                            "color": "#fff"
                        },
                        "position": "inside",
                        formatter: function(p) {
                            return p.value > 0 ? (p.value) : '';
                        }
                    }
                }
            },
            "data": jtxdNum,
        },

            {
                "name": "动态心电",
                "type": "bar",
                "stack": "总量",
                "itemStyle": {
                    "normal": {
                        "color": "rgba(0,191,183,1)",
                        "barBorderRadius": 0,
                        "label": {
                            "show": true,
                            "position": "inside",
                            formatter: function(p) {
                                return p.value > 0 ? (p.value) : '';
                            }
                        }
                    }
                },
                "data":dtxdNum
            },

            {
                "name": "动态血压",
                "type": "bar",
                "stack": "总量",
                "itemStyle": {
                    "normal": {
                        "color": "blue",
                        "barBorderRadius": 0,
                        "label": {
                            "show": true,
                            "position": "inside",
                            formatter: function(p) {
                                return p.value > 0 ? (p.value) : '';
                            }
                        }
                    }
                },
                "data": dtxyNum
            },
            // {
            //     "name": "总数",
            //     "type": "line",
            //     symbolSize:10,
            //     symbol:'circle',
            //     "itemStyle": {
            //         "normal": {
            //             "color": "rgba(252,230,48,1)",
            //             "barBorderRadius": 0,
            //             "label": {
            //                 "show": true,
            //                 "position": "top",
            //                 formatter: function(p) {
            //                     return p.value > 0 ? (p.value) : '';
            //                 }
            //             }
            //         }
            //     },
            //     "data": [
            //         1236,
            //         3993,
            //         2962,
            //         3810,
            //         2519,
            //         1915,
            //         1748,
            //         4675,
            //         6209,
            //         4323,
            //         2865,
            //         4298
            //     ]
            // },
        ]
    }
    myChart.setOption(option);
}

// echart_map中国地图
function echart_map(geoCoordMap,data) {
    var myChart = echarts.init(document.getElementById('chart_map'));
    function showProvince() {
        // var geoCoordMap = {
        //     '泉州市第一医院': [118.604332,24.918366]
        // };
        // data = [
        //     {
        //         name: '泉州市第一医院',
        //         value: [10,'泉州知名医院']
        //     }
        // ];
        var max = 480,
            min = 9;
        var maxSize4Pin = 50,
            minSize4Pin = 20;
        var convertData = function (data) {
            var res = [];
            for (var i = 0; i < data.length; i++) {
                var geoCoord = geoCoordMap[data[i].name];

                if (geoCoord) {
                    res.push({
                        name: data[i].counts,
                        value: geoCoord.concat(data[i].value),
                        counts: data[i].name
                    });
                }
            }
            return res;
        };

        myChart.setOption(option = {
            tooltip: {
                trigger: 'item',
                formatter: function loadData(result){
                    return result.data.counts+'<br />' +result.value[3];
                }
            },
            title: {
                "text": "",
                x:'30%',
                y:'top',
                textStyle: {
                    color: '#fff',
                    fontSize: '32'
                },
                subtextStyle: {
                    color: '#90979c',
                    fontSize: '16',

                },
            },
            geo: {
                zoom:1.2,
                show: true,
                map:'泉州',
                mapType: '泉州',
                label: {
                    normal: {
                        show : true,
                        textStyle:{color:"#3df75b"}
                    },
                    emphasis: {
                        show: true,
                        textStyle: {
                            color: '#fff'
                        }
                    },
                },
                roam: true,
                itemStyle: {
                    normal: {
                        borderColor: 'rgba(147, 235, 248, 1)',
                        borderWidth: 2,
                        areaColor: {
                            type: 'radial',
                            x: 0.5,
                            y: 0.5,
                            r: 0.8,
                            colorStops: [{
                                offset: 0,
                                color: 'rgba(175,238,238, 0)' // 0% 处的颜色
                            }, {
                                offset: 1,
                                color: 'rgba(   47,79,79, .2)' // 100% 处的颜色
                            }],
                            globalCoord: false // 缺省为 false
                        },
                        shadowColor: 'rgba(128, 217, 248, 1)',
                        shadowOffsetX: -2,
                        shadowOffsetY: 2,
                        shadowBlur: 10
                    },
                    emphasis: {
                        areaColor: '#389BB7',
                        borderWidth: 0
                    }
                }
            },
            series: [
                {
                    name: '',
                    type: 'scatter',
                    coordinateSystem: 'geo',
                    symbol: 'pin',
                    symbolSize: function(val) {
                        var a = (maxSize4Pin - minSize4Pin) / (max - min);
                        var b = minSize4Pin - a * min;
                        b = maxSize4Pin - a * max;
                        // console.log(a * val[2] + b);
                        // return a * val[2] + b;
                        return val[2];
                    },
                    label: {
                        normal: {
                            formatter: '{b}',
                            show: true,
                            textStyle: {
                                color: '#fff',
                                fontSize: 10,
                                fontWeight: 'bolder',
                            }
                        }
                    },
                    itemStyle: {
                        normal: {
                            color: 'red', //标志颜色
                        }
                    },
                    zlevel: 6,
                    data: convertData(data),
                },
                {
                    type: 'effectScatter',
                    coordinateSystem: 'geo',
                    data: convertData(data.sort(function (a, b) {
                        return b.value - a.value;
                    }).slice(0, 47)),
                    symbolSize: function (val) {
                        return val[2] / 10;
                    },
                    showEffectOn: 'render',
                    rippleEffect: {
                        brushType: 'stroke'
                    },
                    hoverAnimation: true,
                    itemStyle: {
                        normal: {
                            color: '#f93c20',
                            shadowBlur: 10,
                            shadowColor: '#f93f4c'
                        }
                    },
                    zlevel: 1
                },

            ]
        });
    }
    showProvince();
    myChart.on('click', function (params) {
        $("#el-dialog").removeClass('hide');
        var fruits = ["鲤城区", "丰泽区", "洛江区", "泉港区", "晋江市", "石狮市", "南安市", "惠安县", "安溪县", "永春县", "德化县", "金门县"];
        var indexOfs = fruits.indexOf(params.data.counts);
        if(indexOfs==-1){
            // $("#el-dialog").show();
            // $("#reportTitle").html(params.data.counts);
        }
    });
    window.addEventListener("resize", function () {
        myChart.resize();
    });
}

$(".close").click(function(event) {
    $("#el-dialog").hide();
});

//echart_3货物周转量
function echart_3(strNameList,strNameValList) {
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('chart_3'));
    myChart.clear();

    option = {
        backgroundColor:'',
        title: {
            text: '',
            textStyle: {
                color: '#fff',
                fontSize: 18,
                fontWeight: 'normal',
            }

        },

        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            },
            formatter: "{b} : {c}例"
        },
        legend: {},
        grid: {
            left: '5%',
            right: '4%',
            top: '12%',
            bottom: '5%',
            containLabel: true
        },
        xAxis: {
            type: 'value',
            boundaryGap: [0, 0.01],
            axisTick: {
                show: false
            },
            axisLine: {
                show: false
            },
            axisLabel: {
                /*  textStyle: {
                      color: '#588CBE',
                      fontWeight: 'bolder',
                      fontSize: 10
                  },
                  margin: 8,
                  rotate: 18*/
                show: false
            },
            splitLine: {
                show: false
            }
        },
        yAxis: {
            type: 'category',
            axisLabel: {
                // formatter: '{value}%',
                textStyle: {
                    color: '#ffffff',
                    // fontSize:9,

                }
            },
            //  改变x轴颜色
            axisLine: {
                show: false
            },
            axisTick: {
                show: false,
            },
            lineStyle: {

                // 使用深浅的间隔色
                color: ['#3f0'],
                width: 4,
                type: 'solid'
            },
            data: strNameList
        },
        series: [{
            // name: '设备',
            type: 'bar',
            barWidth: '28%',
            data: strNameValList,
            label: {
                normal: {
                    show: true,
                    position: 'right',
                    formatter: '{c}',
                    textStyle: {
                        color: 'white' //右侧的数字
                    }
                }
            },
            itemStyle: {
                normal: {
                    barBorderRadius: [0, 0, 0, 0],
                    // 		color: '#fdb330',
                    color: function(params) {
                        if(params.dataIndex % 2 === 0) {
                            return '#4BF3FF'
                        } else {
                            return '#4BF3FF'
                        }
                    },
                }
            },

        }],
        dataZoom: [
            {
                type: 'slider',
                show: true,
                yAxisIndex: [0],
                left: '93%',
                start:100,
                end: 50,
                zoomLock:true,
                handleStyle:{
                    color:"#d3dee5",

                },
                textStyle:{
                    color:"#fff"},
                borderColor:"#90979c"
            }
        ],
    };
    myChart.setOption(option);
    var num=1;
    setInterval(function() {
        if(num==1){
            myChart.setOption({
                dataZoom: [
                    {
                        type: 'slider',
                        show: true,
                        yAxisIndex: [0],
                        left: '93%',
                        start:50,
                        end: 0,
                        zoomLock:true,
                        handleStyle:{
                            color:"#d3dee5",

                        },
                        textStyle:{
                            color:"#fff"},
                        borderColor:"#90979c"
                    }
                ]
            });
            num=2;
        }else{
            myChart.setOption({
                dataZoom: [
                    {
                        type: 'slider',
                        show: true,
                        yAxisIndex: [0],
                        left: '93%',
                        start:100,
                        end: 50,
                        zoomLock:true,
                        handleStyle:{
                            color:"#d3dee5",

                        },
                        textStyle:{
                            color:"#fff"},
                        borderColor:"#90979c"
                    }
                ]
            });
            num=1;
        }
    }, 10000);
}


function echart_4(yearZx,yearTitle) {
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('chart_4'));
    myChart.clear();

    var data=JSON.parse(yearZx);
    var name=[data[0].result[0].name,data[0].result[1].name,data[0].result[2].name];
    var xData=[];
    var data1=[],data2=[],data3=[];

    for(var i=0;i<data.length;i++){
        xData.push(data[i].time);
        data1.push(data[i].result[0].value);
        data2.push(data[i].result[1].value);
        data3.push(data[i].result[2].value);
    }
    var option = {
        title: {
            "text": yearTitle,
            x:'5%',
            y:'2%',
            textStyle: {
                color: '#fff',
                fontSize: '22'
            },
            subtextStyle: {
                color: '#90979c',
                fontSize: '16',

            },
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                lineStyle: {
                    color: '#00ffff'

                }
            },
            textStyle:{
                fontSize:14
            }
        },
        legend: {
            show:true,
            icon: 'rect',
            itemWidth: 20,
            itemHeight: 10,
            itemGap: 13,
            data: name,
            right: 'center',
            textStyle: {
                fontSize: 14,
                color: '#fff'
            }
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        // dataZoom:[{
        //     type:'slider',
        //     show:false,
        //     realtime:true,
        //     startValue:0,
        //     endValue:4
        // }],
        xAxis: [{
            type: 'category',
            boundaryGap: false,
            offset:2,
            data: xData,
            axisLabel:{
                show:true,
                textStyle: {
                    color: '#59deee',
                    fontSize:'14'
                }
            },
            axisLine:{show:false},
            axisTick:{show:false},
            splitLine:{show:false}
        }],
        yAxis: [{
            type: 'value',
            boundaryGap: true,
            offset:5,
            axisTick: {
                show: false
            },
            axisLine: {
                show:false
            },
            axisLabel: {
                margin: 5,
                textStyle: {
                    fontSize: 14,
                    color: '#59deee'
                }
            },
            splitLine: {
                lineStyle: {
                    color: '#027b84'
                }
            }
        }],
        series: [{
            name:name[0],
            type: 'line',
            smooth: true,
            symbolSize:3,
            lineStyle: {
                normal: {
                    width: 1,
                    color:'#00ff00'
                }
            },
            areaStyle: {
                normal: {
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                        offset: 0,
                        color: 'rgba(0, 255, 0, 1)'
                    }, {
                        offset: 0.3,
                        color: 'rgba(0, 255, 0, 0.1)'
                    }], false),
                    shadowColor: 'rgba(0, 0, 0, 0.1)',
                    shadowBlur: 10
                }
            },
            itemStyle: {
                normal: {
                    color: '#00ff00',//图例颜色
                    borderColor:'#00ff00',
                    borderWidth:3
                }
            },
            data: data1
        },
            {
                name: name[1],
                type: 'line',
                smooth: true,
                symbolSize:3,
                lineStyle: {
                    normal: {
                        width: 1,
                        color:"#f8555b"
                    }
                },
                areaStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(248, 84, 91, 1)'
                        }, {
                            offset: 0.8,
                            color: 'rgba(248, 84, 91, 0)'
                        }], false),
                        shadowColor: 'rgba(0, 0, 0, 0.1)',
                        shadowBlur: 10
                    }
                },
                itemStyle: {
                    normal: {
                        color:"#f8555b",
                        borderColor:'#f8555b',
                        borderWidth:3
                    }
                },
                data: data2
            },
            {
                name: name[2],
                type: 'line',
                smooth: true,
                symbolSize:3,
                lineStyle: {
                    normal: {
                        width: 1,
                        color:"#c490bf"
                    }
                },
                areaStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(196, 144, 191, 1)'
                        }, {
                            offset: 0.8,
                            color: 'rgba(196, 144, 191, 0)'
                        }], false),
                        shadowColor: 'rgba(0, 0, 0, 0.1)',
                        shadowBlur: 10
                    }
                },
                itemStyle: {
                    normal: {
                        color:"#c490bf",
                        borderColor:'#c490bf',
                        borderWidth:3
                    }
                },
                data: data3
            }, ]
    };
    // var a = 1;

    // setInterval(function () {
    //     if(a == (xData.length-4)){
    //         a=0;
    //     }
    //     myChart.dispatchAction({
    //         type:'dataZoom',
    //         startValue:a,
    //         endValue:a+4
    //     });
    //     a++;
    // },2000)


    myChart.setOption(option);
}

//湖南省飞机场
function echart_5() {
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('chart_5'));

    function showProvince() {
        var geoCoordMap = {
            '长沙黄花国际机场': [113.226512,28.192929],
            '张家界荷花机场': [110.454598,29.107223],
            '常德桃花源机场': [111.651508,28.921516],
            '永州零陵机场': [111.622869,26.340994],
            '怀化芷江机场': [109.714784,27.44615],
        };
        var data = [{
            name: '长沙黄花国际机场',
            value: 100
        },
            {
                name: '张家界荷花机场',
                value: 100
            },
            {
                name: '常德桃花源机场',
                value: 100
            },
            {
                name: '永州零陵机场',
                value: 100
            },
            {
                name: '怀化芷江机场',
                value: 100
            }
        ];
        var max = 480,
            min = 9; // todo
        var maxSize4Pin = 100,
            minSize4Pin = 20;
        var convertData = function (data) {
            var res = [];
            for (var i = 0; i < data.length; i++) {
                var geoCoord = geoCoordMap[data[i].name];
                if (geoCoord) {
                    res.push({
                        name: data[i].name,
                        value: geoCoord.concat(data[i].value)
                    });
                }
            }
            return res;
        };

        myChart.setOption(option = {
            title: {
                top: 20,
                text: '',
                subtext: '',
                x: 'center',
                textStyle: {
                    color: '#ccc'
                }
            },
            legend: {
                orient: 'vertical',
                y: 'bottom',
                x: 'right',
                data: ['pm2.5'],
                textStyle: {
                    color: '#fff'
                }
            },
            visualMap: {
                show: false,
                min: 0,
                max: 500,
                left: 'left',
                top: 'bottom',
                text: ['高', '低'], // 文本，默认为数值文本
                calculable: true,
                seriesIndex: [1],
                inRange: {
                }
            },
            geo: {
                show: true,
                map:'hunan',
                mapType: 'hunan',
                label: {
                    normal: {
                    },
                    //鼠标移入后查看效果
                    emphasis: {
                        textStyle: {
                            color: '#fff'
                        }
                    }
                },
                //鼠标缩放和平移
                roam: true,
                itemStyle: {
                    normal: {
                        //          	color: '#ddd',
                        borderColor: 'rgba(147, 235, 248, 1)',
                        borderWidth: 1,
                        areaColor: {
                            type: 'radial',
                            x: 0.5,
                            y: 0.5,
                            r: 0.8,
                            colorStops: [{
                                offset: 0,
                                color: 'rgba(175,238,238, 0)' // 0% 处的颜色
                            }, {
                                offset: 1,
                                color: 'rgba(	47,79,79, .2)' // 100% 处的颜色
                            }],
                            globalCoord: false // 缺省为 false
                        },
                        shadowColor: 'rgba(128, 217, 248, 1)',
                        shadowOffsetX: -2,
                        shadowOffsetY: 2,
                        shadowBlur: 10
                    },
                    emphasis: {
                        areaColor: '#389BB7',
                        borderWidth: 0
                    }
                }
            },
            series: [{
                name: 'light',
                type: 'map',
                coordinateSystem: 'geo',
                data: convertData(data),
                itemStyle: {
                    normal: {
                        color: '#F4E925'
                    }
                }
            },
                {
                    name: '点',
                    type: 'scatter',
                    coordinateSystem: 'geo',
                    symbol: 'pin',
                    symbolSize: function(val) {
                        var a = (maxSize4Pin - minSize4Pin) / (max - min);
                        var b = minSize4Pin - a * min;
                        b = maxSize4Pin - a * max;
                        return a * val[2] + b;
                    },
                    label: {
                        normal: {
                            // show: true,
                            // textStyle: {
                            //     color: '#fff',
                            //     fontSize: 9,
                            // }
                        }
                    },
                    itemStyle: {
                        normal: {
                            color: '#F62157', //标志颜色
                        }
                    },
                    zlevel: 6,
                    data: convertData(data),
                },
                {
                    name: 'light',
                    type: 'map',
                    mapType: 'hunan',
                    geoIndex: 0,
                    aspectScale: 0.75, //长宽比
                    showLegendSymbol: false, // 存在legend时显示
                    label: {
                        normal: {
                            show: false
                        },
                        emphasis: {
                            show: false,
                            textStyle: {
                                color: '#fff'
                            }
                        }
                    },
                    roam: true,
                    itemStyle: {
                        normal: {
                            areaColor: '#031525',
                            borderColor: '#FFFFFF',
                        },
                        emphasis: {
                            areaColor: '#2B91B7'
                        }
                    },
                    animation: false,
                    data: data
                },
                {
                    name: ' ',
                    type: 'effectScatter',
                    coordinateSystem: 'geo',
                    data: convertData(data.sort(function (a, b) {
                        return b.value - a.value;
                    }).slice(0, 5)),
                    symbolSize: function (val) {
                        return val[2] / 10;
                    },
                    showEffectOn: 'render',
                    rippleEffect: {
                        brushType: 'stroke'
                    },
                    hoverAnimation: true,
                    label: {
                        normal: {
                            formatter: '{b}',
                            position: 'right',
                            show: true
                        }
                    },
                    itemStyle: {
                        normal: {
                            color: '#05C3F9',
                            shadowBlur: 10,
                            shadowColor: '#05C3F9'
                        }
                    },
                    zlevel: 1
                },

            ]
        });
    }
    showProvince();

    // 使用刚指定的配置项和数据显示图表。
    // myChart.setOption(option);
    window.addEventListener("resize", function () {
        myChart.resize();
    });
}
//点击跳转
// $('#chart_map').click(function(){
//     window.location.href = './page/index.html';
// });
// $('.t_btn2').click(function(){
//     window.location.href = "./page/index.html?id=2";
// });
// $('.t_btn3').click(function(){
//     window.location.href = "./page/index.html?id=3";
// });
// $('.t_btn4').click(function(){
//     window.location.href = "./page/index.html?id=4";
// });
// $('.t_btn5').click(function(){
//     window.location.href = "./page/index.html?id=5";
// });
// $('.t_btn6').click(function(){
//     window.location.href = "./page/index.html?id=6";
// });
// $('.t_btn7').click(function(){
//     window.location.href = "./page/index.html?id=7";
// });
// $('.t_btn8').click(function(){
//     window.location.href = "./page/index.html?id=8";
// });
// $('.t_btn9').click(function(){
//     window.location.href = "./page/index.html?id=9";
// });


/** 消息状态码 */
web_status = {
    SUCCESS: 0,
    FAIL: 500,
    WARNING: 301
};